/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.mvc.log;

import com.gestores.GestionLogs;
import com.mvc.RequestHandler;
import java.io.IOException;
import java.util.ArrayList;
import javax.naming.NamingException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 *
 * @author victor
 */
public class VerListadoLog implements RequestHandler{

    public void handleRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, NamingException {
        String pagActual=request.getParameter("pagActual");
        if(pagActual==null) pagActual="1";
        
        int pagInt=Integer.parseInt(pagActual);
        
        ArrayList lista=GestionLogs.getInstance().getListaLog(pagInt);
        
        String numPagTotal=""+GestionLogs.getInstance().getPagTotal();
        
        request.setAttribute("pagActual", pagActual);
        request.setAttribute("numPagTotal", numPagTotal);
        request.setAttribute("lista", lista);
        
    }

}
